package fr.univ.lr.icone.unit;

import java.awt.Point;

import junit.framework.TestCase;
import fr.univ.lr.icone.gui.event.Event;
import fr.univ.lr.icone.gui.event.EventType;

public class EventTestCase extends TestCase {

	public void testGetAgentID() {
		Event event = new Event(001, EventType.NONE);
		assertEquals(001, event.getAgentID());
	}

	public void testGetEventType() {
		Event event = new Event(001, EventType.NONE);
		assertEquals(EventType.NONE, event.getEventType());
	}

	public void testGetOpinion() {
		Event event = new Event(001, EventType.NONE, 9);
		assertEquals(9, event.getOpinion());
	}

	public void testGetPosition() {
		Event event = new Event(001, EventType.NONE, new Point(8, 10));
		assertEquals(new Point(8, 10), event.getPosition());
	}

	public void testGetOldPosition() {
		Event event = new Event(001, EventType.NONE, 1, new Point(5, 10),
				new Point(5, 19));
		assertEquals(new Point(5, 19), event.getOldPosition());
	}

	public void testToString() {
		Event event = new Event(001, EventType.NONE, 1, new Point(5, 10),
				new Point(5, 19));
		assertEquals(
				"Event [agentID=1, oldPosition=java.awt.Point[x=5,y=19], opinion=1, position=java.awt.Point[x=5,y=10], type=NONE]",
				event.toString());
	}

}
